module.exports = {
  root: true,
  env: {
    browser: true,
    es2021: true,
    node: true,
  },
  extends: [
    "eslint:recommended",
    "plugin:vue/vue3-recommended",
    "plugin:@typescript-eslint/recommended",
    "prettier", // 确保 Prettier 的规则优先
  ],
  parserOptions: {
    ecmaVersion: 12,
    sourceType: "module",
  },
  plugins: [
    "vue",
    "@typescript-eslint",
    "prettier", // 注册 Prettier 插件
  ],
  rules: {
    "prettier/prettier": "error", // 将 Prettier 的格式化规则作为 ESLint 错误处理
    "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
    "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
    "vue/multi-word-component-names": "off", // 关闭 Vue 组件命名规则
    "max-len": ["error", { code: 120 }], // 增加最大行宽
    "function-paren-newline": ["error", "multiline"], // 允许多行参数
  },
};
